package com.lykj.llw.box.adapter

import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.lykj.llw.box.R
import com.lykj.llw.box.data.bean.response.GameActivityResponse
import java.text.SimpleDateFormat
import java.util.Date

/**
 * ================================================
 * 游戏公告列表适配器
 * ================================================
 *
 * @author gosha
 * @date 2023/11/2-14:43
 */
class GameActivityAdapter :
    BaseQuickAdapter<GameActivityResponse.DataDTO, BaseViewHolder>(R.layout.item_game_activity) {
    val sdf = SimpleDateFormat("yyyy-MM-dd HH:mm:ss")
    override fun convert(holder: BaseViewHolder, item: GameActivityResponse.DataDTO) {
        if (item.type == 1) {
            holder.setText(R.id.tv_type, "游戏攻略")
        } else {
            holder.setText(R.id.tv_type, "游戏公告")
        }

        holder.setText(R.id.tv_title, "${item.title}")
        holder.setText(R.id.tv_time, "${item.releaseTime}")
    }
}